package com.gs.gms.dao.impl;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.gs.gms.common.exceptions.GmsDataAccessException;
import com.gs.gms.core.dao.impl.GmsCommonDaoImpl;
import com.gs.gms.dao.UserConnectionDao;
import com.gs.gms.model.entity.User;
import com.gs.gms.model.entity.UserConnection;

@Repository
public class UserConnectionDaoImpl extends GmsCommonDaoImpl<UserConnection, Long> implements UserConnectionDao {

	private static Logger logger = Logger.getLogger(UserConnectionDaoImpl.class);
	
	@Override
	public UserConnection saveConnection(UserConnection connection)
			throws GmsDataAccessException {
		try {
			getEntityManager().persist(connection);
			getEntityManager().flush();
		} catch (Exception e) {
			logger.error(e);
			throw new GmsDataAccessException(e);
		}
		logger.info("Insert User, successful...");
		return connection;
		
	}

	

	
	
}
